﻿#ifndef _SOCKETLIBFUNCTION_H
#define _SOCKETLIBFUNCTION_H

#include "socketlibtypes.h"

namespace SocketLib
{

class SocketApi
{
public:
    static void     InitSocket();
    static void     DestorySocket();
    static bool     SetNonblock(sock aSocket, bool bBlock = true);
    static sock     MakeConnect(const char* pServerip, int aServerPort);
    static sock     MakeListen(int aPort, int aBacknum = 5);
    static void     CloseSocket(sock aSock);

    static const char*  GetIP(unsigned int);
    static int      SendData(sock aSock, const char* pBuffer, int aBufferLen);

#if defined PLATFORM_WINDOWS
    static  WSADATA g_WSAData;
#else
#endif
};

}

#endif
